package com.edwin.websitebe.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.edwin.websitebe.model.Customer;
import com.edwin.websitebe.model.Sample;
import com.edwin.websitebe.service.CustomerService;
import com.edwin.websitebe.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/customer")
public class CustomerController {

    @Autowired
    private CustomerService service;

    @GetMapping("")
    public ResultVO list(Customer customer) {
        Page<Customer> page = service.pageList(customer);
        return new ResultVO().success(page);
    }

    @DeleteMapping("/delete")
    public ResultVO delete(@RequestParam Long id) {
        boolean result = service.removeById(id);
        return new ResultVO().success();
    }

}
